1. Field of the Invention
The invention relates to transferring data between devices in a computer system, and more particularly, to a circuit that performs data format conversion when data is transferred between devices which utilize different data formats.
2. Description of the Related Art
In computer systems, two types of formats are used for ordering data: little-endian and big-endian. FIG. 6 illustrates the little-endian and big-endian data formats for a 32-bit doubleword. In the doubleword, bit 31 is the most significant data bit and bit 0 is the least significant data bit. In each doubleword, there are 4 bytes each corresponding to a specific address. In the little-endian format, the most significant byte consisting of data bits 31-24 is accessed by the most significant address A+3, and the least significant byte consisting of bits 7-0 is accessed by the least significant address A. Conversely, in the big-endian data format, the least significant byte consisting of bits 7-0 is accessed by the most significant address A+3, and the most significant byte consisting of bits 31-24 is accessed by the least significant address A.
The 80.times.86 processors from Intel Corporation normally use the little-endian method for storing data that are larger than one byte. However, the 80.times.86 processors do include an instruction BSWAP (byte swap) that converts the byte ordering of 32-bit data. The BSWAP instruction converts data having little-endian format into big-endian format and vice versa.
In computer systems where the central processing unit is an Intel 80.times.86 processor, the data format used is typically the little-endian format. Nonetheless, peripheral devices which are based on the big-endian format are sometimes used in the 80.times.86-processor-based computer systems. To function properly, these devices must include circuitry to perform little-endian/big-endian data format conversion.
Certain bus devices fetch both instructions and data from computer system memory. The instructions and data are typically used in the same data format by the bus device. In some applications, however, instructions are always double-word aligned but data are not necessarily double-word aligned, which may require that instructions not be converted but data are. For example, the Tachyon Fibre Channel controller from Hewlett Packard uses all four bytes of double-word aligned instructions, which makes data format conversion unnecessary for the instructions. However, received data may not be double-word aligned, which makes byte accessibility within the four bytes of data important. Thus, data format conversion is not necessary if the transferred information consists of instructions but conversion is needed if the transferred information consists of data. As a result, information received by the Fibre Channel controller is used in the little-endian data format if the information consists of instructions and in the big-endian data format if the information consists of data.